package com.dfrz.planeclub.utill;

import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;

@ControllerAdvice
public class ExceptionAutoUtil {

    //统一异常处理
    @ResponseBody
    @ExceptionHandler(RuntimeException.class)
    public BaseResult error(RuntimeException re) {
        //记录日志
        re.printStackTrace();
        return BaseResult.exceptionResult();
    }

}
